﻿<RibbonWindow x:Class="Daphne.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:b3 = "clr-namespace:Board3D;assembly=Board3D"
        xmlns:b2 = "clr-namespace:Board2D;assembly=Board2D"
        xmlns:ctrl = "clr-namespace:Daphne.Controls"
        xmlns:local ="clr-namespace:Daphne"
        xmlns:loc="http://schemas.tomer.com/winfx/2006/xaml/presentation"                                       
        Title="Daphne Checkers 2013" Height="768" Width="1024" MinWidth="800" MinHeight="630"             
        Icon="/Daphne;component/AppData/Pictures/dama_cerna.png" 
       x:Name="Window"
       Background="{DynamicResource WindowBackgroundBrush}"
         WindowStartupLocation="CenterScreen" >      

    <RibbonWindow.CommandBindings>
        <CommandBinding Command="{x:Static local:Commands.PersonView}" CanExecute="CanExecutePersonView" Executed="ExecutePersonView"  />
        <CommandBinding Command="{x:Static local:Commands.TopView}" CanExecute="CanExecuteTopView" Executed="ExecuteTopView" />
        <CommandBinding Command="{x:Static local:Commands.ComputerAdvice}" CanExecute="CanExecuteComputerAdvice" Executed="ExecuteComputerAdvice" />
        <CommandBinding Command="{x:Static local:Commands.SaveGame}" CanExecute="CanExecuteSaveGame" Executed="ExecuteSaveGame" />
        <CommandBinding Command="{x:Static local:Commands.LoadGame}" CanExecute="CanExecuteLoadGame" Executed="ExecuteLoadGame" />
        <CommandBinding Command="{x:Static local:Commands.NewGame}" CanExecute="CanExecuteNewGame" Executed="ExecuteNewGame" />
        <CommandBinding Command="{x:Static local:Commands.ExitApplication}" CanExecute="CanExecuteExitApplication" Executed="ExecuteExitApplication" />
        <CommandBinding Command="{x:Static local:Commands.ToggleBoardType}" CanExecute="CanExecuteToggleBoardType" Executed="ExecuteToggleBoardType" />
        <CommandBinding Command="{x:Static local:Commands.ToggleComputerGame}" CanExecute="CanExecuteToggleComputerGame" Executed="ExecuteToggleComputerGame" />
        <CommandBinding Command="{x:Static local:Commands.StartStopEngineMatch}" CanExecute="CanExecuteEngineMatch" Executed="ExecuteEngineMatch" />
        <CommandBinding Command="{x:Static local:Commands.MoveStart}" CanExecute="CanExecuteMoveBack" Executed="ExecuteMoveStart" />
        <CommandBinding Command="{x:Static local:Commands.MoveBack}" CanExecute="CanExecuteMoveBack" Executed="ExecuteMoveBack" />
        <CommandBinding Command="{x:Static local:Commands.MoveForward}" CanExecute="CanExecuteMoveForward" Executed="ExecuteMoveForward" />
        <CommandBinding Command="{x:Static local:Commands.MoveEnd}" CanExecute="CanExecuteMoveForward" Executed="ExecuteMoveEnd" />
        <CommandBinding Command="{x:Static local:Commands.RotateBoard}" CanExecute="CanExecuteRotateBoard" Executed="ExecuteRotateBoard" />
        <CommandBinding Command="{x:Static local:Commands.ClearBoard}" CanExecute="CanExecuteClearBoard" Executed="ExecuteClearBoard" />
        <CommandBinding Command="{x:Static local:Commands.EditMode}" CanExecute="CanExecuteEditMode" Executed="ExecuteEditMode" />
        <CommandBinding Command="Help" CanExecute="CanExecuteAbout" Executed="ExecuteAbout" />
        <CommandBinding Command="{x:Static local:Commands.Licenses}" CanExecute="CanExecuteLicenses" Executed="ExecuteLicenses" />
        <CommandBinding Command="{x:Static local:Commands.ComputerLevel}" CanExecute="CanExecuteComputerLevel" Executed="ExecuteComputerLevel" />
        <CommandBinding Command="{x:Static local:Commands.RecentFileOpen}" CanExecute="CanExecuteRecentFileOpen" Executed="ExecuteRecentFileOpen" />
        <CommandBinding Command="{x:Static local:Commands.SetTheme}" CanExecute="CanExecuteSetTheme" Executed="ExecuteSetTheme" />
        <CommandBinding Command="{x:Static local:Commands.SetLanguage}" CanExecute="CanExecuteSetLanguage" Executed="ExecuteSetLanguage" />
        <CommandBinding Command="{x:Static local:Commands.GraphicsLevel}" CanExecute="CanExecuteGraphicsLevel" Executed="ExecuteGraphicsLevel" />
    </RibbonWindow.CommandBindings>
    

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="46" x:Name="uxRibbonRow"/>
            <RowDefinition Height="0" />
            <RowDefinition Height="0" />
            <RowDefinition Height="*" />
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="5*" x:Name="uxBoardCol" />
            <ColumnDefinition Width="3*"  />
        </Grid.ColumnDefinitions>
        <Ribbon x:Name="uxRibbon" Grid.Row="0" Grid.ColumnSpan="2">
            <Ribbon.ApplicationMenu>
                <local:SlimRibbonApplicationMenu x:Name="uxRibbonAppMenu"  Width="100" Label="Daphne" ShowAuxilaryPanel="True" PopupWidth="10"  FlowDirection="LeftToRight"  >
                    <local:SlimRibbonApplicationMenu.AuxiliaryPaneContent>
                        <ctrl:RecentFileListControl x:Name="uxRecentFileList" OpenCommand="{x:Static local:Commands.RecentFileOpen}" />
                    </local:SlimRibbonApplicationMenu.AuxiliaryPaneContent>
                    <RibbonApplicationMenuItem loc:Translate.Uid="RIB_NewGame" Header="{loc:Translate}" ImageSource="AppData\Pictures\new_game.png" 
                                               Command="{x:Static local:Commands.NewGame}"  >
                    </RibbonApplicationMenuItem>

                    <RibbonApplicationMenuItem loc:Translate.Uid="RIB_OpenGame" Header="{loc:Translate}"  ImageSource="AppData\Pictures\load_game.png"
                                               Command="{x:Static local:Commands.LoadGame}">
                    </RibbonApplicationMenuItem>
                    <RibbonApplicationMenuItem loc:Translate.Uid="RIB_SaveGame" Header="{loc:Translate}" ImageSource="AppData\Pictures\save_game.png"
                                               Command="{x:Static local:Commands.SaveGame}">
                    </RibbonApplicationMenuItem>
                    <RibbonSeparator />
                    <RibbonApplicationMenuItem loc:Translate.Uid="RIB_EngineLevel" Header="{loc:Translate}">
                        <RibbonApplicationMenuItem x:Name="uxLevel1"  Command="{x:Static local:Commands.ComputerLevel}" CommandParameter="1">
                            <RibbonApplicationMenuItem.Header>
                                <StackPanel Orientation="Vertical">
                                    <TextBlock loc:Translate.Uid="RIB_Level1" Text="{loc:Translate}"></TextBlock>
                                    <TextBlock loc:Translate.Uid="RIB_Configuration" Text="{loc:Translate}"></TextBlock>
                                    <TextBlock FontStyle="Italic" loc:Translate.Uid="RIB_Config1" Text="{loc:Translate}"></TextBlock>
                                </StackPanel>
                            </RibbonApplicationMenuItem.Header>
                        </RibbonApplicationMenuItem>
                        <RibbonApplicationMenuItem x:Name="uxLevel2"  Command="{x:Static local:Commands.ComputerLevel}" CommandParameter="2">
                            <RibbonApplicationMenuItem.Header>
                                <StackPanel Orientation="Vertical">
                                    <TextBlock loc:Translate.Uid="RIB_Level2" Text="{loc:Translate}"></TextBlock>
                                    <TextBlock loc:Translate.Uid="RIB_Configuration" Text="{loc:Translate}"></TextBlock>
                                    <TextBlock FontStyle="Italic" loc:Translate.Uid="RIB_Config2" Text="{loc:Translate}"></TextBlock>
                                </StackPanel>
                            </RibbonApplicationMenuItem.Header>
                        </RibbonApplicationMenuItem>
                        <RibbonApplicationMenuItem x:Name="uxLevel3"  Command="{x:Static local:Commands.ComputerLevel}" CommandParameter="3">
                            <RibbonApplicationMenuItem.Header>
                                <StackPanel Orientation="Vertical">
                                    <TextBlock loc:Translate.Uid="RIB_Level3" Text="{loc:Translate}"></TextBlock>
                                    <TextBlock loc:Translate.Uid="RIB_Configuration" Text="{loc:Translate}"></TextBlock>
                                    <TextBlock FontStyle="Italic" loc:Translate.Uid="RIB_Config3" Text="{loc:Translate}"></TextBlock>
                                </StackPanel>
                            </RibbonApplicationMenuItem.Header>
                        </RibbonApplicationMenuItem>
                        <RibbonApplicationMenuItem x:Name="uxLevel4"  Command="{x:Static local:Commands.ComputerLevel}" CommandParameter="4" >
                            <RibbonApplicationMenuItem.Header>
                                <StackPanel Orientation="Vertical">
                                    <TextBlock loc:Translate.Uid="RIB_Level4" Text="{loc:Translate}" ></TextBlock>
                                    <TextBlock loc:Translate.Uid="RIB_Configuration" Text="{loc:Translate}"></TextBlock>
                                    <TextBlock FontStyle="Italic" loc:Translate.Uid="RIB_Config4" Text="{loc:Translate}"></TextBlock>
                                </StackPanel>
                            </RibbonApplicationMenuItem.Header>
                        </RibbonApplicationMenuItem>
                        <RibbonApplicationMenuItem x:Name="uxLevel5"  Command="{x:Static local:Commands.ComputerLevel}" CommandParameter="5">
                            <RibbonApplicationMenuItem.Header>
                                <StackPanel Orientation="Vertical">
                                    <TextBlock loc:Translate.Uid="RIB_Level5" Text="{loc:Translate}"></TextBlock>
                                    <TextBlock loc:Translate.Uid="RIB_Configuration" Text="{loc:Translate}"></TextBlock>
                                    <TextBlock FontStyle="Italic" loc:Translate.Uid="RIB_Config5" Text="{loc:Translate}"></TextBlock>
                                </StackPanel>
                            </RibbonApplicationMenuItem.Header>
                        </RibbonApplicationMenuItem>
                    </RibbonApplicationMenuItem>
                    <RibbonSeparator />
                    <RibbonApplicationMenuItem loc:Translate.Uid="RIB_SetTheme" Header="{loc:Translate}">
                        <RibbonApplicationMenuItem x:Name="uxThemeClassic" loc:Translate.Uid="RIB_ClassicTheme" Header="{loc:Translate}" Command="{x:Static local:Commands.SetTheme}"
                                                   CommandParameter="0" />
                        <RibbonApplicationMenuItem x:Name="uxThemeBlackWhite" loc:Translate.Uid="RIB_BlackWhiteTheme" Header="{loc:Translate}" Command="{x:Static local:Commands.SetTheme}"
                                                   CommandParameter="1" />
                        <RibbonApplicationMenuItem x:Name="uxThemeMarble" loc:Translate.Uid="RIB_MarbleTheme" Header="{loc:Translate}" Command="{x:Static local:Commands.SetTheme}"
                                                   CommandParameter="2" />
                    </RibbonApplicationMenuItem>
                    <RibbonApplicationMenuItem loc:Translate.Uid="RIB_SetGraphicsLevel" Header="{loc:Translate}">
                        <RibbonApplicationMenuItem x:Name="uxGraphLevel1" loc:Translate.Uid="RIB_GraphLevel1" Header="{loc:Translate}" Command="{x:Static local:Commands.GraphicsLevel}"
                                                   CommandParameter="1" />
                        <RibbonApplicationMenuItem x:Name="uxGraphLevel2" loc:Translate.Uid="RIB_GraphLevel2" Header="{loc:Translate}" Command="{x:Static local:Commands.GraphicsLevel}"
                                                   CommandParameter="2" />
                        <RibbonApplicationMenuItem x:Name="uxGraphLevel3" loc:Translate.Uid="RIB_GraphLevel3" Header="{loc:Translate}" Command="{x:Static local:Commands.GraphicsLevel}"
                                                   CommandParameter="3" />
                        <RibbonApplicationMenuItem x:Name="uxGraphLevel4" loc:Translate.Uid="RIB_GraphLevel4" Header="{loc:Translate}" Command="{x:Static local:Commands.GraphicsLevel}"
                                                   CommandParameter="4" />
                    </RibbonApplicationMenuItem>
                    <RibbonApplicationMenuItem loc:Translate.Uid="RIB_SetLanguage" Header="{loc:Translate}" Command="{x:Static local:Commands.SetLanguage}" >
                    </RibbonApplicationMenuItem>
                    <RibbonSeparator />
                    <RibbonApplicationMenuItem loc:Translate.Uid="RIB_Licenses" Header="{loc:Translate}" Command="{x:Static local:Commands.Licenses}" >
                    </RibbonApplicationMenuItem>
                    <RibbonApplicationMenuItem loc:Translate.Uid="RIB_About" Header="{loc:Translate}" Command="Help" >
                    </RibbonApplicationMenuItem>
                    <RibbonSeparator />
                    <RibbonApplicationMenuItem loc:Translate.Uid="RIB_Exit" Header="{loc:Translate}" Command="{x:Static local:Commands.ExitApplication}">
                    </RibbonApplicationMenuItem>
                </local:SlimRibbonApplicationMenu>                               
            </Ribbon.ApplicationMenu>           
        </Ribbon>

        <Grid Grid.Row="3" Grid.Column="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="1*" x:Name="uxBoard2DRow" />
                <RowDefinition Height="0" x:Name="uxBoard3DRow" />
                <RowDefinition Height="90" />
            </Grid.RowDefinitions>
            <b2:ProfessionalGameBoard Grid.Row="0" x:Name="uxBoard2D"   VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Visibility="Collapsed"/>
            <b3:Board3D x:Name="uxBoard3D" Grid.Row="1" />

            <Grid Grid.Row="2" MinWidth="490">                
                <Grid.Resources>
                    <Style TargetType="Button">
                        <Style.Setters>
                            <Setter Property="Margin" Value="3" />
                        </Style.Setters>
                    </Style>
                    <Style  TargetType="ctrl:HoverButton">
                        <Style.Setters>
                            <Setter Property="Margin" Value="3" />
                        </Style.Setters>
                    </Style>
                </Grid.Resources>
                <Grid HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="15" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="15" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>                    
                    <ctrl:OnMoveControl x:Name="uxOnMove" Grid.Column="0" Margin="3" Height="40" /> 
                    <StackPanel Orientation="Horizontal" Grid.Column="2" Height="46">
                        <ctrl:HoverButton  Command="{x:Static local:Commands.RotateBoard}" loc:Translate.Uid="TT_RotateBoard" ToolTip="{loc:Translate}"
                                Image="butt_rotate.png" HoverImage="over_butt_rotate.png"/>
                        <ctrl:HoverButton Command="{x:Static local:Commands.EditMode}" loc:Translate.Uid="TT_PositionEditor" ToolTip="{loc:Translate}"
                               Image="butt_editor.png" HoverImage="over_butt_editor.png"  />
                        <ctrl:HoverButton Command="{x:Static local:Commands.ClearBoard}" loc:Translate.Uid="TT_ClearBoard" ToolTip="{loc:Translate}"
                               Image="butt_no.png" HoverImage="over_butt_no.png"  />
                        <ctrl:HoverButton loc:Translate.Uid="TT_EngineAdvice" ToolTip="{loc:Translate}" Command="{x:Static local:Commands.ComputerAdvice}"
                              Image="butt_help.png" HoverImage="over_butt_help.png" />
                        <ctrl:HoverButton Command="{x:Static local:Commands.ToggleComputerGame}" loc:Translate.Uid="TT_GameType" ToolTip="{loc:Translate}"
                              Image="butt_1-2.png" HoverImage="over_butt_1-2.png" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Grid.Column="4" Height="46">
                        <ctrl:StateHoverButton Command="{x:Static local:Commands.ToggleBoardType}" loc:Translate.Uid="TT_BoardType" ToolTip="{loc:Translate}"
                               Image="butt_switch.png" HoverImage="over_butt_switch.png"
                               OnImage="butt_switch_back.png" OnHoverImage="over_butt_switch_back.png" x:Name="uxBoardTypeButton"    />
                        <ctrl:HoverButton loc:Translate.Uid="TT_PersonView" ToolTip="{loc:Translate}" Command="{x:Static local:Commands.PersonView}"
                               Image="eye.png" HoverImage="over_eye.png" />
                        <ctrl:HoverButton Command="{x:Static local:Commands.TopView}" loc:Translate.Uid="TT_TopView" ToolTip="{loc:Translate}"
                              Image="butt_top.png" HoverImage="over_butt_top.png" />
                    </StackPanel>

                </Grid>
            </Grid>
        </Grid>


        <Grid Grid.Column="1" Grid.Row="3">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="30" />                
                <RowDefinition Height="70" />
                <RowDefinition Height="100" />
            </Grid.RowDefinitions>
            <ctrl:GameStateControl Grid.Row="0" Margin="3" x:Name="uxGameList" />
            <Grid Grid.Row="1">
                <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
                    <ctrl:HoverButton  Command="{x:Static local:Commands.MoveStart}" loc:Translate.Uid="TT_MoveToBeg" ToolTip="{loc:Translate}"
                        Image="step_start_game.png" HoverImage="over_step_start_game.png" />
                    <ctrl:HoverButton Command="{x:Static local:Commands.MoveBack}" loc:Translate.Uid="TT_MoveBack" ToolTip="{loc:Translate}" 
                        Image="step_back_game.png" HoverImage="over_step_back_game.png" />
                    <ctrl:HoverButton  Command="{x:Static local:Commands.MoveForward}" loc:Translate.Uid="TT_MoveForward" ToolTip="{loc:Translate}" 
                             Image="step_forward_game.png" HoverImage="over_step_forward_game.png"   />
                    <ctrl:HoverButton Command="{x:Static local:Commands.MoveEnd}" loc:Translate.Uid="TT_MoveToEnd" ToolTip="{loc:Translate}" 
                              Image="step_end_game.png" HoverImage="over_step_end_game.png" />
                </StackPanel>
            </Grid>           
            <!--<ctrl:MasterTabControl x:Name="uxMasterTab"/>-->
            <ctrl:FigureCountControl  Margin="5" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Stretch" x:Name="uxFigureCountCtrl"  />
            <ctrl:GameStatus Grid.Row="3" Margin="3" x:Name="uxGameStatus" />
        </Grid>
                 
        <StatusBar Grid.Row="4" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" >            
            <StatusBarItem >
                <Label Foreground="{DynamicResource TextBrush}" x:Name="uxDepthLabel" 
                       loc:Translate.Uid="SB_Depth" Content="{loc:Translate}"></Label>
            </StatusBarItem>
            <Separator Background="{DynamicResource ButtonBorderBrush}" />
            <StatusBarItem>
                <Label  Foreground="{DynamicResource TextBrush}" x:Name="uxNumberOfNodes" 
                        loc:Translate.Uid="SB_NodeCount" Content="{loc:Translate}"></Label>                
            </StatusBarItem>
            <Separator Background="{DynamicResource ButtonBorderBrush}" />
            <StatusBarItem>
                <Label  Foreground="{DynamicResource TextBrush}" x:Name="uxNodesPerSec"
                        loc:Translate.Uid="SB_NodesPerSec" Content="{loc:Translate}"></Label>
            </StatusBarItem>
            <Separator Background="{DynamicResource ButtonBorderBrush}"/>
            <StatusBarItem   HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="{Binding ElementName=uxProgressName, Path=Width}" />
                        <ColumnDefinition  Width="*" />
                    </Grid.ColumnDefinitions>
                    <Label  Foreground="{DynamicResource TextBrush}" x:Name="uxProgressName" Grid.Column="0" HorizontalAlignment="Right"/>
                    <ProgressBar x:Name="uxProgressBar"  Grid.Column="1"  HorizontalAlignment="Stretch"/>
                </Grid>              
            </StatusBarItem>
        </StatusBar>
    </Grid>
</RibbonWindow>
